package cn.iocoder.yudao.module.pypm.dal.mysql.projectstage;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pypm.dal.dataobject.projectstage.ProjectStageDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pypm.controller.admin.projectstage.vo.*;

/**
 * 项目阶段 Mapper
 *
 * @author 钦州码头
 */
@Mapper
public interface ProjectStageMapper extends BaseMapperX<ProjectStageDO> {

    default PageResult<ProjectStageDO> selectPage(ProjectStagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProjectStageDO>()
                .likeIfPresent(ProjectStageDO::getName, reqVO.getName())
                .betweenIfPresent(ProjectStageDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ProjectStageDO::getDescription, reqVO.getDescription())
                .eqIfPresent(ProjectStageDO::getPeriod, reqVO.getPeriod())
                .eqIfPresent(ProjectStageDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(ProjectStageDO::getUserId, reqVO.getUserId())
                .orderByDesc(ProjectStageDO::getId));
    }

}